package com.whfc.ms.api.emp.service.impl;

import com.whfc.common.result.ListData;
import com.whfc.common.result.PageData;
import com.whfc.emp.dto.AppEmpRewardDTO;
import com.whfc.emp.param.AppEmpRewardAddParam;
import com.whfc.emp.service.AppRewardService;
import com.whfc.ms.api.emp.service.MsRewardService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * @ClasssName MsRewardServiceImpl
 * @Description 人员奖惩
 * @Author hw
 * @Date 2020/12/2 11:57
 * @Version 1.0
 */
@Service
public class MsRewardServiceImpl implements MsRewardService {

    @DubboReference(interfaceClass = AppRewardService.class, version = "1.0.0", timeout = 10 * 1000)
    private AppRewardService appRewardService;

    @Override
    public PageData<AppEmpRewardDTO> list(Integer projectId, Integer pageNum, Integer pageSize, Date startDate, Date endDate, String keyword) {
        return appRewardService.list(projectId, pageNum, pageSize, startDate, endDate, keyword);
    }

    @Override
    public void add(AppEmpRewardAddParam param) {
        appRewardService.add(param);
    }

    @Override
    public void del(Integer id) {
        appRewardService.del(id);
    }

    @Override
    public ListData<AppEmpRewardDTO> getRewardList(Integer empId) {
        List<AppEmpRewardDTO> list = appRewardService.getRewardList(empId);
        return new ListData<>(list);
    }

    @Override
    public void delList(List<Integer> ids) {
        appRewardService.delList(ids);
    }
}
